home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60src.lha / Vim / vim60 / src / testdir / test3.ok < prev    next >
Encoding:
Text File  |  2001-07-19  |  7.5 KB  |  802 lines

  1. /* start of AUTO matically checked */
  2. {
  3.     if (test)
  4.         cmd1;
  5.     cmd2;
  6. }
  7.  
  8. {
  9.     if (test)
  10.         cmd1;
  11.     else
  12.         cmd2;
  13. }
  14.  
  15. {
  16.     if (test)
  17.     {
  18.         cmd1;
  19.         cmd2;
  20.     }
  21. }
  22.  
  23. {
  24.     if (test)
  25.     {
  26.         cmd1;
  27.         else
  28.     }
  29. }
  30.  
  31. {
  32.     while (this)
  33.         if (test)
  34.             cmd1;
  35.     cmd2;
  36. }
  37.  
  38. {
  39.     while (this)
  40.         if (test)
  41.             cmd1;
  42.         else
  43.             cmd2;
  44. }
  45.  
  46. {
  47.     if (test)
  48.     {
  49.         cmd;
  50.     }
  51.  
  52.     if (test)
  53.         cmd;
  54. }
  55.  
  56. {
  57.     if (test) {
  58.         cmd;
  59.     }
  60.  
  61.     if (test) cmd;
  62. }
  63.  
  64. {
  65.     cmd1;
  66.     for (blah)
  67.         while (this)
  68.             if (test)
  69.                 cmd2;
  70.     cmd3;
  71. }
  72.  
  73. {
  74.     cmd1;
  75.     for (blah)
  76.         while (this)
  77.             if (test)
  78.                 cmd2;
  79.     cmd3;
  80.  
  81.     if (test)
  82.     {
  83.         cmd1;
  84.         cmd2;
  85.         cmd3;
  86.     }
  87. }
  88.  
  89.  
  90. /* Test for 'cindent' do/while mixed with if/else: */
  91.  
  92. {
  93.     do
  94.         if (asdf)
  95.             asdfasd;
  96.     while (cond);
  97.  
  98.     do
  99.         if (asdf)
  100.             while (asdf)
  101.                 asdf;
  102.     while (asdf);
  103. }
  104.  
  105. /* Test for 'cindent' with two ) on a continuation line */
  106. {
  107.     if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d
  108.             aal;sdkjf  ( ;asldfkja;sldfk
  109.                 al;sdjfka ;slkdf ) sa;ldkjfsa dlk;)
  110.         line up here;
  111. }
  112.  
  113.  
  114. /* C++ tests: */
  115.  
  116. // foo()        these three lines should remain in column 0
  117. // {
  118. // }
  119.  
  120. /* Test for continuation and unterminated lines: */
  121. {
  122.     i = 99 + 14325 +
  123.         21345 +
  124.         21345 +
  125.         21345 + ( 21345 +
  126.                 21345) +
  127.         2345 +
  128.         1234;
  129.     c = 1;
  130. }
  131.  
  132. /*
  133.    testje for indent with empty line
  134.  
  135.    here */
  136.  
  137. {
  138.     if (testing &&
  139.             not a joke ||
  140.             line up here)
  141.         hay;
  142.     if (testing &&
  143.             (not a joke || testing
  144.             )line up here)
  145.         hay;
  146.     if (testing &&
  147.             (not a joke || testing
  148.              line up here))
  149.         hay;
  150. }
  151.  
  152.  
  153. {
  154.     switch (c)
  155.     {
  156.         case xx:
  157.             do
  158.                 if (asdf)
  159.                     do
  160.                         asdfasdf;
  161.                     while (asdf);
  162.                 else
  163.                     asdfasdf;
  164.             while (cond);
  165.         case yy:
  166.         case xx:
  167.         case zz:
  168.             testing;
  169.     }
  170. }
  171.  
  172. {
  173.     if (cond) {
  174.         foo;
  175.     }
  176.     else
  177.     {
  178.         bar;
  179.     }
  180. }
  181.  
  182. {
  183.     if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf
  184.                 alsdkfj (asldk;fj
  185.                     awith cino=(0 ;lf this one goes to below the paren with ==
  186.                         ;laksjfd ;lsakdjf ;alskdf asd)
  187.                     asdfasdf;)))
  188.         asdfasdf;
  189. }
  190.  
  191.     int
  192. func(a, b)
  193.     int a;
  194.     int c;
  195. {
  196.     if (c1 && (c2 ||
  197.                 c3))
  198.         foo;
  199.     if (c1 &&
  200.             (c2 || c3)
  201.        )
  202. }
  203.  
  204. {
  205.     while (asd)
  206.     {
  207.         if (asdf)
  208.             if (test)
  209.                 if (that)
  210.                 {
  211.                     if (asdf)
  212.                         do
  213.                             cdasd;
  214.                         while (as
  215.                                 df);
  216.                 }
  217.                 else
  218.                     if (asdf)
  219.                         asdf;
  220.                     else
  221.                         asdf;
  222.         asdf;
  223.     }
  224. }
  225.  
  226. {
  227.     s = "/*"; b = ';'
  228.         s = "/*"; b = ';';
  229.     a = b;
  230. }
  231.  
  232. {
  233.     switch (a)
  234.     {
  235.         case a:
  236.             switch (t)
  237.             {
  238.                 case 1:
  239.                     cmd;
  240.                     break;
  241.                 case 2:
  242.                     cmd;
  243.                     break;
  244.             }
  245.             cmd;
  246.             break;
  247.         case b:
  248.             {
  249.                 int i;
  250.                 cmd;
  251.             }
  252.             break;
  253.         case c: {
  254.                     int i;
  255.                     cmd;
  256.                 }
  257.         case d: if (cond &&
  258.                         test) {        /* this line doesn't work right */
  259.                     int i;
  260.                     cmd;
  261.                 }
  262.                 break;
  263.     }
  264. }
  265.  
  266. {
  267.     if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) &&
  268.             (bp_to->b_p_initialized ||
  269.              (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
  270.         return;
  271. label :
  272.     asdf = asdf ?
  273.         asdf : asdf;
  274.     asdf = asdf ?
  275.         asdf: asdf;
  276. }
  277.  
  278. /* Special Comments    : This function has the added complexity (compared  */
  279. /*                    : to addtolist) of having to check for a detail     */
  280. /*                    : texture and add that to the list first.             */
  281.  
  282. char *(array[100]) = {
  283.     "testje",
  284.     "foo",
  285.     "bar",
  286. }
  287.  
  288. {
  289.     struct Type
  290.     {
  291.         int i;
  292.         char *str;
  293.     } var[] =
  294.     {
  295.         0, "zero",
  296.         1, "one",
  297.         2, "two",
  298.         3, "three"
  299.     };
  300.  
  301.     float matrix[3][3] =
  302.     {
  303.         {
  304.             0,
  305.             1,
  306.             2
  307.         },
  308.         {
  309.             3,
  310.             4,
  311.             5
  312.         },
  313.         {
  314.             6,
  315.             7,
  316.             8
  317.         }
  318.     };
  319. }
  320.  
  321. {
  322.     /* blah ( blah */
  323.     /* where does this go? */
  324.  
  325.     /* blah ( blah */
  326.     cmd;
  327.  
  328.     func(arg1,
  329.             /* comment */
  330.             arg2);
  331.     a;
  332.     {
  333.         b;
  334.         {
  335.             c; /* Hey, NOW it indents?! */
  336.         }
  337.     }
  338.  
  339.     {
  340.         func(arg1,
  341.                 arg2,
  342.                 arg3);
  343.         /* Hey, what am I doing here?  Is this coz of the ","? */
  344.     }
  345. }
  346.  
  347. main ()
  348. {
  349.     if (cond)
  350.     {
  351.         a = b;
  352.     }
  353.     if (cond) {
  354.         a = c;
  355.     }
  356.     if (cond)
  357.         a = d;
  358.     return;
  359. }
  360.  
  361. {
  362.     case 2: if (asdf &&
  363.                     asdfasdf)
  364.                 aasdf;
  365.             a = 9;
  366.     case 3: if (asdf)
  367.                 aasdf;
  368.             a = 9;
  369.     case 4:    x = 1;
  370.                y = 2;
  371.  
  372. label:    if (asdf)
  373.             here;
  374.  
  375. label:  if (asdf &&
  376.                 asdfasdf)
  377.         {
  378.         }
  379.  
  380. label:  if (asdf &&
  381.                 asdfasdf) {
  382.             there;
  383.         }
  384.  
  385. label:  if (asdf &&
  386.                 asdfasdf)
  387.             there;
  388. }
  389.  
  390. {
  391.     /*
  392.        hello with ":set comments= cino=c5"
  393.      */
  394.  
  395.     /*
  396.        hello with ":set comments= cino="
  397.      */
  398. }
  399.  
  400.  
  401. {
  402.     if (a < b) {
  403.         a = a + 1;
  404.     } else
  405.         a = a + 2;
  406.  
  407.     if (a)
  408.         do {
  409.             testing;
  410.         } while (asdfasdf);
  411.     a = b + 1;
  412.     asdfasdf
  413. }
  414.  
  415. class bob
  416. {
  417.     int foo() {return 1;}
  418.     int bar;
  419. }
  420.  
  421. main()
  422. {
  423.     while(1)
  424.         if (foo)
  425.         {
  426.             bar;
  427.         }
  428.         else {
  429.             asdf;
  430.         }
  431.     misplacedline;
  432. }
  433.  
  434. {
  435.     if (clipboard.state == SELECT_DONE
  436.             && ((row == clipboard.start.lnum
  437.                     && col >= clipboard.start.col)
  438.                 || row > clipboard.start.lnum))
  439. }
  440.  
  441. {
  442.     if (1) {i += 4;}
  443.     where_am_i;
  444.     return 0;
  445. }
  446.  
  447. {
  448.     {
  449.     } // sdf(asdf
  450.     if (asdf)
  451.         asd;
  452. }
  453.  
  454. {
  455. label1:
  456. label2:
  457. }
  458.  
  459. {
  460.     int fooRet = foo(pBar1, false /*fKB*/,
  461.             true /*fPTB*/, 3 /*nT*/, false /*fDF*/);
  462.     f() {
  463.         for ( i = 0;
  464.                 i < m;
  465.                 /* c */ i++ ) {
  466.             a = b;
  467.         }
  468.     }
  469. }
  470.  
  471. {
  472.     f1(/*comment*/);
  473.     f2();
  474. }
  475.  
  476. {
  477.     do {
  478.         if (foo) {
  479.         } else
  480.             ;
  481.     } while (foo);
  482.     foo();    // was wrong
  483. }
  484.  
  485. int x;        // no extra indent because of the ;
  486. void func()
  487. {
  488. }
  489.  
  490. char *tab[] = {"aaa",
  491.     "};", /* }; */ NULL}
  492.     int indented;
  493. {}
  494.  
  495. char *tab[] = {"aaa",
  496.     "xx", /* xx */};    /* asdf */
  497. int not_indented;
  498.  
  499. {
  500.     do {
  501.         switch (bla)
  502.         {
  503.             case 1: if (foo)
  504.                         bar;
  505.         }
  506.     } while (boo);
  507.     wrong;
  508. }
  509.  
  510. int    foo,
  511.     bar;
  512. int foo;
  513.  
  514. char * xx = "asdf\
  515.     foo\
  516.     bor";
  517. int x;
  518.  
  519. /* end of AUTO */
  520.  
  521.  
  522. {
  523.  
  524. /* this is
  525.  * a real serious
  526.  * about life, the
  527.  * universe, and the
  528.  * rest important big
  529.  * comment
  530.  */
  531.     /* insert " about life, the universe, and the rest" after "serious" */
  532. }
  533.  
  534.  
  535. {
  536.     /*
  537.      * Testing for comments, without 'cin' set
  538.      */
  539. about life
  540.  
  541. /*
  542. * what happens here?
  543. */
  544. there
  545.  
  546.     /*
  547.        the end of the comment, try inserting a line below */
  548. line
  549.  
  550.         /* how about
  551. hello
  552.                         this one */
  553. }
  554.  
  555.  
  556. {
  557.     var = this + that + vec[0] * vec[0]
  558.                       + vec[1] * vec[1]
  559.                       + vec2[2] * vec[2];
  560. }
  561.  
  562.  
  563. {
  564.         asdf asdflkajds f;
  565.     if (tes & ting) {
  566.         asdf asdf asdf ;
  567.         asdfa sdf asdf;
  568.         }
  569.     testing1;
  570.     if (tes & ting)
  571.     {
  572.         asdf asdf asdf ;
  573.         asdfa sdf asdf;
  574.         }
  575.     testing2;
  576. }
  577.  
  578.  
  579. main ( int first_par, /*
  580.                        * Comment for
  581.                        * first par
  582.                        */
  583.        int second_par /*
  584.                        * Comment for
  585.                        * second par
  586.                        */
  587.      )
  588. {
  589.     func( first_par, /*
  590.                       * Comment for
  591.                       * first par
  592.                       */
  593.           second_par /*
  594.                       * Comment for
  595.                       * second par
  596.                       */
  597.         );
  598.  
  599. }
  600.  
  601.  
  602. {
  603.     do
  604.     {
  605.         if ()
  606.         {
  607.             if ()
  608.                 asdf;
  609.             else
  610.                 asdf;
  611.         }
  612.     } while ();
  613.     cmd;        /* this should go under the } */
  614. }
  615.  
  616.  
  617. void f()
  618. {
  619.     if ( k() ) {
  620.         l();
  621.  
  622.     } else { /* Start (two words) end */
  623.         m();
  624.     }
  625.  
  626.     n();
  627. }
  628.  
  629.  
  630. void f()
  631.     {
  632.     if ( k() )
  633.         {
  634.         l();
  635.         } else { /* Start (two words) end */
  636.         m();
  637.         }
  638.     n();    /* should be under the if () */
  639. }
  640.  
  641.  
  642. void bar(void)
  643.     {
  644.     static array[2][2] =
  645.         {
  646.             { 1, 2 },
  647.             { 3, 4 },
  648.         }
  649.  
  650.     while (a)
  651.         {
  652.         foo(&a);
  653.         }
  654.  
  655.         {
  656.         int a;
  657.             {
  658.             a = a + 1;
  659.             }
  660.         }
  661.     b = a;
  662.     }
  663.  
  664. void func(void)
  665.     {
  666.     a = 1;
  667.         {
  668.         b = 2;
  669.         }
  670.     c = 3;
  671.     d = 4;
  672.     }
  673. /* foo */
  674.  
  675.  
  676. a()
  677. {
  678.   do {
  679.     a = a +
  680.       a;
  681.   } while ( a );        /* add text under this line */
  682.   here
  683.     if ( a )
  684.       a;
  685. }
  686.  
  687.  
  688. a()
  689. {
  690. label1:
  691.             /* hmm */
  692.             // comment
  693. label2: b();
  694. label3 /* post */:
  695. /* pre */ label4:
  696.         f(/*com*/);
  697.         if (/*com*/)
  698.             cmd();
  699. }
  700.  
  701.  
  702. /*
  703.  * A simple comment
  704.  */
  705.  
  706. /*
  707. ** A different comment
  708. */
  709.  
  710.  
  711. void f()
  712. {
  713.  
  714.     /*********
  715.       A comment.
  716.     *********/
  717. }
  718.  
  719.  
  720. void f()
  721. {
  722.  
  723.     /*********
  724.     A comment.
  725.     *********/
  726. }
  727.  
  728.  
  729. void f()
  730. {
  731.     c = c1 &&
  732.         (
  733.          c2 ||
  734.          c3
  735.         ) && c4;
  736. }
  737.  
  738.  
  739. void f()
  740. {
  741.     c = c1 &&
  742.         (
  743.          c2 ||
  744.          c3
  745.         ) && c4;
  746. }
  747.  
  748.  
  749. void f()
  750. {
  751.     c = c1 &&
  752.         (
  753.             c2 ||
  754.             c3
  755.         ) && c4;
  756. }
  757.  
  758.  
  759. void f()
  760. {
  761.     if (   c1
  762.            && (   c2
  763.                   || c3))
  764.         foo;
  765. }
  766.  
  767.  
  768. void f()
  769. {
  770.     if (   c1
  771.         && (   c2
  772.             || c3))
  773.         foo;
  774. }
  775.  
  776.  
  777. void f()
  778. {
  779.     c = c1 && (
  780.         c2 ||
  781.         c3
  782.         ) && c4;
  783.     if (
  784.         c1 && c2
  785.        )
  786.         foo;
  787. }
  788.  
  789.  
  790. void f()
  791. {
  792.     c = c1 && (
  793.         c2 ||
  794.         c3
  795.     ) && c4;
  796.     if (
  797.         c1 && c2
  798.     )
  799.         foo;
  800. }
  801.  
  802.